   
    
    $(function() {
            var userInfo = $.cookie('login_cookie');
            if (userInfo != null && userInfo != "") {
    			var name = userInfo.split("%")[1];
    			$(".header-left").html(
    					"欢迎，"+name+"&nbsp;&nbsp;&nbsp;<a href='javascript:void(0)' class='link-logout' onclick='logout()'>[退出]</a>"		
    			);
    		} else {
    			window.location.href = ("login.html");
    		}
         $.ajax({
        		url:"student/selectname",
        		data:{'name':name},
        		type:"post",
        		dataType:"json",
        		async:false,
        		success:function(data){
        			if(data!=null){
        	             $("#table_list").append(
        	            		 "<tr><td>"
        	            		 + data.id + "</td><td>"
        	            		 + data.name + "</td><td>"
        	            		 + data.gender + "</td><td>"
        	            		 +data.phone +"</td><td>"
        	            		 + data.age + "</td><td>"
        	            		 +data.addr + "</td><td>"
        	            		 +data.schedule + "</td><td>"
        	            		 +data.teacher + "</td><td>"
        	            		 +"<a href='update-check.html?"+data.id+"') style='cursor:pointer'><i class='fa  fa-pencil'>&nbsp;修改</i></a>&nbsp;&nbsp;"
        	            		 
        	            		 );
        				}
        			}
        	})
    	//为注册按钮绑定点击注册时间  出发regist方法
    	$("#stu_search").click(function(){
    		
    		return serach();
    	});
    }) 
    function logout() {
		$.ajax({
			url : "user/logout",
			type : "post",
			dateType : "json",
			success : function(data) {
				window.location.reload();
			},
			error : function(e) {
				alert("请求失败！");
			}
		})
    }
